package com.bestcem.xm.ticket.util;

import com.bestcem.xm.ticket.entity.mongo.Ticket;
import com.bestcem.xm.ticket.enums.TicketEventEnum;
import com.bestcem.xm.ticket.service.manager.fsm.TicketFsmManager;
import com.bestcem.xm.ticket.service.manager.record.param.TransferParam;

/**
 * ticketfsm 工单流转
 * @author jy.zhao
 * @version 1.0
 * @date 2021/11/29 14:26
 **/
public class TicketFsmRunnable implements Runnable {

    private Ticket ticket;
    private TicketEventEnum ticketEventEnum;
    private TransferParam transferParam;
    private TicketFsmManager ticketFsmManager;

    @Override
    public void run() {
        ticketFsmManager.transfer(ticket, ticketEventEnum, transferParam);
    }

    public TicketFsmRunnable(Ticket ticket, TicketEventEnum ticketEventEnum, TransferParam transferParam, TicketFsmManager ticketFsmManager) {
        this.ticket = ticket;
        this.ticketEventEnum = ticketEventEnum;
        this.transferParam = transferParam;
        this.ticketFsmManager = ticketFsmManager;
    }
}
